//
//  TopView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/12.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "TopView.h"
#import <Masonry.h>
@implementation TopView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    self.backgroundColor = [UIColor whiteColor];
    
    self.payBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.payBtn setTitle:@"支付卡" forState:(UIControlStateNormal)];
    [self.payBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.payBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    [self addSubview:self.payBtn];
    [self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(80);
        make.top.mas_equalTo(10);
    }];
    
    self.receiptBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.receiptBtn setTitle:@"收款卡" forState:(UIControlStateNormal)];
    [self.receiptBtn setTitleColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.receiptBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    [self addSubview:self.receiptBtn];
    [self.receiptBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-80);
        make.top.mas_equalTo(10);
    }];
    
    
    
    self.linView = [[UIView alloc] init];
    self.linView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self addSubview:self.linView];
    [self.linView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(1);
        make.bottom.equalTo(self.mas_bottom);
    }];
    
    self.payImv = [[UIImageView alloc] init];
    self.payImv.image = [UIImage imageNamed:@"icon_line"];
    [self addSubview:self.payImv];
    [self.payImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.linView.mas_top);
        make.centerX.equalTo(self.payBtn);
    }];
    
    self.receiptImv = [[UIImageView alloc] init];
    self.receiptImv.image = [UIImage imageNamed:@"icon_line"];
    [self addSubview:self.receiptImv];
    [self.receiptImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.linView.mas_top);
        make.centerX.equalTo(self.receiptBtn);
    }];
    
    
}

@end
